package ru.susu.algebra.ranks;

import java.math.BigInteger;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

import ru.susu.algebra.util.NumberUtilities;

/**
 * @author akargapolov
 * @since: 04.05.2011
 */
public class BellNumbersCompare
{
	private static Logger _log = Logger.getLogger("bell");

	public static void main(String[] args)
	{
		BasicConfigurator.configure();
		for (int i = 1;i <= 100;i++)
		{
			BigInteger tmp = BigInteger.ZERO;
			for (int k = 1;k <= i - 1;k++)
			{
				tmp = tmp.add(
						NumberUtilities.cnk(i, k).multiply(
								BigInteger.valueOf(2).pow(i - k - 1)));
			}
			_log.info(i + ": " + NumberUtilities.bellNumber(i) + " " + tmp);
		}

	}

}
